#include "work3.h"
#include "ui_work3.h"
#include "mainwindow.h"
#include "main.h"
#include <string>
#include <cstring>
#include "login_suc.h"
#include "login_fail.h"
work3::work3(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::work3)
{
    ui->setupUi(this);
}

work3::~work3()
{
    delete ui;
}

void work3::on_pushButton_clicked()
{
    std::string account = ui->lineEdit->text().toStdString();
    std::string key = ui->lineEdit_2->text().toStdString();
    if(account==account_true&&key==key_true){
        users = 1;
        login_suc *new_dialog;
        new_dialog = new login_suc;
        new_dialog->show();
    }else {
        users = 0;
        login_fail *new_dialog;
        new_dialog = new login_fail;
        new_dialog->show();
    }
}

void work3::on_lineEdit_2_textEdited(const QString &arg1)
{
    ui->lineEdit_2->setEchoMode(QLineEdit::Password);
}
